﻿using MvvmHelpers;
using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.ObjectModel;

namespace GreenXi.Model
{
    public partial class ManualModel : BindableBase
    {
        #region 操作定义

        //手动模式控制压机运动
        public DelegateCommand<object> ClickMouse { get; set; }

        //释放按钮停止运动
        public DelegateCommand<object> PreviewMouse { get; set; }
        #endregion

        #region 压力
        //压机1压力
        private string _Pressure1;
        public string Pressure1
        {
            get { return _Pressure1 + "kn"; }
            set
            {
                SetProperty(ref _Pressure1, value);
            }
        }

        private string _Pressure2;
        //压机2
        public string Pressure2
        {
            get { return _Pressure2 + "kn"; }
            set
            {
                SetProperty(ref _Pressure2, value);
            }
        }

        private double _CurrentMaxPressure1;
        public double CurrentMaxPressure1
        {
            get { return _CurrentMaxPressure1; }
            set
            {
                SetProperty(ref _CurrentMaxPressure1, value);
            }
        }

        private double _CurrentMaxPressure2;
        public double CurrentMaxPressure2
        {
            get { return _CurrentMaxPressure2; }
            set
            {
                SetProperty(ref _CurrentMaxPressure2, value);
            }
        }

        #endregion

        #region 位移
        //压机1位移
        private string _Displacement1;
        public string Displacement1
        {
            get => _Displacement1 + "mm";
            set
            {
                SetProperty(ref _Displacement1, value);
            }
        }


        //压机2
        private string _Displacement2;
        public string Displacement2
        {
            get => _Displacement2 + "mm";
            set
            {
                SetProperty(ref _Displacement2, value);
            }
        }

        private double _CurrentMaxDisplacement1;
        public double CurrentMaxDisplacement1
        {
            get => _CurrentMaxDisplacement1 ;
            set
            {
                SetProperty(ref _CurrentMaxDisplacement1, value);
            }
        }

        private double _CurrentMaxDisplacement2;
        public double CurrentMaxDisplacement2
        {
            get => _CurrentMaxDisplacement2;
            set
            {
                SetProperty(ref _CurrentMaxDisplacement2, value);
            }
        }
        #endregion

        #region 是否合格
        private string _IsQualified1 = "Beige";
        public string IsQualified1
        {
            get { return _IsQualified1; }
            set
            {
                SetProperty(ref _IsQualified1, value);
            }
        }

        private string _IsQualified2 = "Beige";
        public string IsQualified2
        {
            get { return _IsQualified2; }
            set { SetProperty(ref _IsQualified2, value); }
        }
        #endregion

        public string _StartIcon1;
        public string StartIcon1
        {
            get => _StartIcon1;
            set
            {
                SetProperty(ref _StartIcon1, value);
            }
        }
        public string _StartIcon2;
        public string StartIcon2
        {
            get => _StartIcon2;
            set
            {
                SetProperty(ref _StartIcon2, value);
            }
        }
        public bool _IsIndicatorVisibleIcon1;
        public bool IsIndicatorVisibleIcon1
        {
            get => _IsIndicatorVisibleIcon1;
            set
            {
                SetProperty(ref _IsIndicatorVisibleIcon1, value);
            }
        }
        public bool _IsIndicatorVisibleIcon2;
        public bool IsIndicatorVisibleIcon2
        {
            get => _IsIndicatorVisibleIcon2;
            set
            {
                SetProperty(ref _IsIndicatorVisibleIcon2, value);
            }
        }

        public DelegateCommand<object> SwitchButton1 { get; set; }
        public DelegateCommand<object> SwitchButton2 { get; set; }
        public DelegateCommand<object> ClearCurveCommand { get; set; }

        private ObservableCollection<String>? _FunctionOptions1;
        public ObservableCollection<String>? FunctionOptions1
        {
            get => _FunctionOptions1;
            set
            {
                SetProperty(ref _FunctionOptions1, value);
            }
        }
        private ObservableCollection<String>? _FunctionOptions2;
        public ObservableCollection<String>? FunctionOptions2
        {
            get => _FunctionOptions2;
            set
            {
                SetProperty(ref _FunctionOptions2, value);
            }
        }

        /// <summary>
        /// 压装程序
        /// </summary>
        public string _PressingProcedure1 = "";
        public string PressingProcedure1
        {
            get => _PressingProcedure1;
            set
            {
                SetProperty(ref _PressingProcedure1, value);
            }
        }
        /// <summary>
        /// 压装程序
        /// </summary>
        public string _PressingProcedure2 = "";
        public string PressingProcedure2
        {
            get => _PressingProcedure2;
            set
            {
                SetProperty(ref _PressingProcedure2, value);
            }
        }
    }
}
